﻿<Window x:Class="wpf4gp.Views.ExceptionMessageBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:local="clr-namespace:wpf4gp.Properties" 
        xmlns:dc="clr-namespace:wpf4gp.Dependencies"
        xmlns:converters="clr-namespace:wpf4gp.Converters"
        dc:DialogCloser.DialogResult="{Binding DialogResult}"
        WindowStartupLocation="CenterOwner"
        WindowState="Normal"
        Title="{Binding Path=Title}" SizeToContent="WidthAndHeight" ResizeMode="NoResize"
        >
    <Window.Resources>
        <converters:BoolVisibleHiddenConverter x:Key="boolVisibleHiddenConverter" />
    </Window.Resources>
    <StackPanel Orientation="Vertical">
        <Label Grid.ColumnSpan="3" Content="{Binding Path=Message}" 
                 Margin="5" VerticalAlignment="Stretch"
                 VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Grid.Row="1" Command="{Binding Path=DetailsCommand}"
                Height="40" Width="100"
                Visibility="{Binding Path=CanViewDetails, Converter={StaticResource boolVisibleHiddenConverter}}"
                Content="{x:Static local:Resources.ExceptionMessageBox_Details}"
                Margin="5" Background="Transparent"/>
            <Button Grid.Row="1" Grid.Column="2" Command="{Binding Path=CloseCommand}" 
                Height="40" Width="100"
                Content="{x:Static local:Resources.ExceptionMessageBox_Close}"
                Margin="5" Background="Transparent" IsCancel="True" IsDefault="True"/>
        </StackPanel>
    </StackPanel>
</Window>
